import { cx } from "@/utils";
import { Badge } from "@arco-design/web-react";
import { memo } from "react";
import style from './index.module.scss';

const txtMap = {
    done: '拆分完毕',
    ing: '拆分中',
    todo: '待拆分'
};

interface IProps {
    /**
     * 当前状态
     */
    status: 'done' | 'ing' | 'todo';
}

/**
 * 价值规划拆分进度
 */
const VpStatus = memo(({status}: IProps) => {
    const color = status === 'done' ? 'success' : status === 'ing' ? 'processing' : 'error';
    const cls = cx([style[status], style.status]);
    return (
        <div className={cls}>
            <Badge status={color} text={txtMap[status]} />
        </div>
    );
});

export {
    VpStatus
};

